//
//  IMGameStrategyModels.h
//  DualMediationSDK
//
//  产品策略相关模型
//  Created by YeJary on 2025/7/15.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/**
 * 产品策略请求模型
 */
@interface IMGameStrategyRequest : NSObject

/**
 * 应用ID（必选）
 */
@property (nonatomic, strong) NSString *app_id;

/**
 * 用户唯一ID（必选）
 */
@property (nonatomic, strong) NSString *uuid;

/**
 * 便利构造方法
 * @param appId 应用ID
 * @param uuid 用户唯一ID
 */
+ (instancetype)requestWithAppId:(NSString *)appId uuid:(NSString *)uuid;

/**
 * 转换为请求参数字典
 */
- (NSDictionary *)toDictionary;

@end

/**
 * 产品策略条件模型
 */
@interface IMGameConditions : NSObject

/**
 * 当前等级
 */
@property (nonatomic, strong, nullable) NSNumber *cur_level;

/**
 * 等级间隔
 */
@property (nonatomic, strong, nullable) NSNumber *level_interval;

/**
 * AdMob优先
 */
@property (nonatomic, strong, nullable) NSNumber *ad_mob_first;

/**
 * 其他扩展条件（支持动态字段）
 */
@property (nonatomic, strong, nullable) NSDictionary *additionalConditions;

/**
 * 从字典创建实例
 * @param dictionary 条件数据字典
 */
+ (instancetype)conditionsFromDictionary:(NSDictionary *)dictionary;

@end

/**
 * 产品策略动作模型
 */
@interface IMGameActions : NSObject

/**
 * 等级组合
 */
@property (nonatomic, strong, nullable) NSString *level_combine;

/**
 * 其他扩展动作（支持动态字段）
 */
@property (nonatomic, strong, nullable) NSDictionary *additionalActions;

/**
 * 从字典创建实例
 * @param dictionary 动作数据字典
 */
+ (instancetype)actionsFromDictionary:(NSDictionary *)dictionary;

@end

/**
 * 产品策略模型
 */
@interface IMGameStrategy : NSObject

/**
 * 比例
 */
@property (nonatomic, assign) NSInteger rate;

/**
 * 策略ID
 */
@property (nonatomic, strong) NSString *strategy_id;

/**
 * 策略条件
 */
@property (nonatomic, strong, nullable) IMGameConditions *conditions;

/**
 * 策略动作
 */
@property (nonatomic, strong, nullable) IMGameActions *actions;

/**
 * 从字典创建实例
 * @param dictionary 策略数据字典
 */
+ (instancetype)strategyFromDictionary:(NSDictionary *)dictionary;

@end

/**
 * 产品场景策略模型
 */
@interface IMGameSceneStrategy : NSObject

/**
 * 场景名称
 */
@property (nonatomic, strong) NSString *scene_name;

/**
 * 场景描述
 */
@property (nonatomic, strong) NSString *scene_desc;

/**
 * 国家/地区数组
 */
@property (nonatomic, strong) NSArray<NSString *> *country;

/**
 * 用户类型 1:新用户 2:老用户 3:全用户
 */
@property (nonatomic, assign) NSInteger user_type;

/**
 * 渠道数组
 */
@property (nonatomic, strong) NSArray<NSString *> *channels;

/**
 * 策略列表
 */
@property (nonatomic, strong) NSArray<IMGameStrategy *> *strategy;

/**
 * 从字典创建实例
 * @param dictionary 场景策略数据字典
 */
+ (instancetype)sceneStrategyFromDictionary:(NSDictionary *)dictionary;

@end

/**
 * 产品策略响应模型
 */
@interface IMGameStrategyResponse : NSObject

/**
 * 响应状态码
 */
@property (nonatomic, assign) NSInteger code;

/**
 * 响应消息
 */
@property (nonatomic, strong) NSString *message;

/**
 * 响应数据 - 产品场景策略数组
 */
@property (nonatomic, strong, nullable) NSArray<IMGameSceneStrategy *> *data;

/**
 * 是否成功
 */
@property (nonatomic, assign, readonly) BOOL isSuccess;

/**
 * 从字典创建实例
 * @param dictionary 响应字典
 */
+ (instancetype)responseFromDictionary:(NSDictionary *)dictionary;

@end

NS_ASSUME_NONNULL_END